using UnityEngine;
using System.Collections;

/// \class  gkUtilityAngle
/// \brief  Angle utility function
public class gkUtilityAngle 
{
	/// \brief  Compute the direct differance between two angles
	public static float ComputeDirectAngleDifference(float a_fAngleA, float a_fAngleB)
	{
		float fDirectAngleDifference;
		
		fDirectAngleDifference = a_fAngleA - a_fAngleB;
		
		// Get the more direct angle
		if(fDirectAngleDifference >= 180.0f)
		{
			fDirectAngleDifference -= 360.0f;	
		}
		else if(fDirectAngleDifference <= -180.0f)
		{
			fDirectAngleDifference += 360.0f;
		}
		
		return fDirectAngleDifference;
	}
}
